package AtmSystem;

public class BankAccount 
{
	private int cardNumber;
	private double balance;
	private double amount;
	public BankAccount(int initialCardNumber, double initialBalance)
	{
		cardNumber=initialCardNumber;
		balance=initialBalance;

	}

	public int getCardNumber()
	{
		return cardNumber;
	}

	public double getBanlance()
	{
		return balance;
	}

   public void setBalance(double newBalance)
	{
	   balance=newBalance;
	}

	public double getBalance()
	{
		return balance;
	}

	public boolean deposit(double newDeposit)
	{
		amount= newDeposit;
			balance = balance + newDeposit;
			return true;
	}
	public boolean withdraw(double newWithdraw)
	{
		if (balance < newWithdraw)
			return false;
		else 
		{
			amount=newWithdraw;
			balance = balance - newWithdraw;
			return true;
			}
		}	

	public double getAmount()
		{
			return amount;
		}
}
